import sys
import time

import EmpVotingTestBed
import EmpVoting


from EmpVoting.PythonUtils import XmlSerializer

if __name__ == '__main__':
    startTime = time.time()
    
    if (len(sys.argv) == 1):
        sys.argv.append("config.xml")
        
    xmlSerializer = XmlSerializer(rootModuleList=[EmpVotingTestBed, EmpVoting])
        
    for fileName in sys.argv[1:]:       
        experiment = xmlSerializer.DeserializeFromFile(fileName)
        
        experiment.Run()
        
    elapsedTime = time.time() - startTime
    print("Finished running experiments in " + str(elapsedTime) + " seconds.")